const buildings = 
[
[
	"Fuel Collector",
	[
		"space",
		"fuel_collector.png",
		[
			[
				4,
				1
			],
			[
				"energy",
				"chemical supplies"
			]
		],
		[
			[
				30
			],
			[
				"hydrogen fuel"
			]
		]
	]
],
[
	"Gas Collector",
	[
		"nebula",
		"gas_collector.png",
		[
			[
				2,
				2,
				2
			],
			[
				"food",

				"energy",

				"water"
			]
		],
		[
			[
				20
			],
			[
				"nebula gas"
			]
		]
	]
],
[
	"Space Farm",
	[
		"space",
		"space_farm.png",
		[
			[
				4,
				5
			],
			[
				"energy",
				"animal embryos"
			]
		],
		[
			[
				8,
				2,
				1
			],
			[
				"food",
				"water",
				"bio waste"
			]
		]
	]
],
[
	"Energy Well",
	[
		"energy",
		"energy_well.png",
		[
			[
				1,
				1
			],
			[
				"food",
				"water"
			]
		],
		[
			[
				4
			],
			[
				"energy"
			]
		]
	]
],
[
	"Chemical Laboratory",
	[
		"nebula",
		"chemical_laboratory.png",
		[
			[
				1,
				3,
				1
			],
			[
				"food",
				"energy",
				"water"
			]
		],
		[
			[
				9
			],
			[
				"chemical supplies"
			]
		]
	]
],
[
	"Asteroid Mine",
	[
		"asteriods",
		"asteroid_mine.png",
		[
			[
				1,
				1,
				1
			],
			[
				"food",
				"energy",
				"water"
			]
		],
		[
			[
				9,
				2
			],
			[
				"ore",
				"gem stones"
			]
		]
	]
],
[
	"Radiation Collector",
	[
		"space",
		"radiation_collector.png",
		[
			[
				1,
				3,
				1
			],
			[
				"food",
				"energy",
				"water"
			]
		],
		[
			[
				6
			],
			[
				"radioactive cells"
			]
		]
	]
],
[
	"Medical Laboratory",
	[
		"space",
		"medical_laboratory.png",
		[
			[
				2,
				2,
				2,
				7
			],
			[
				"food",
				"energy",
				"water",
				"nebula gas"
			]
		],
		[
			[
				4
			],
			[
				"medicines"
			]
		]
	]
],
[
	"Brewery",
	[
		"space",
		"brewery.png",
		[
			[
				2,
				2,
				2,
				4
			],
			[
				"food",
				"energy",
				"water",
				"chemical supplies"
			]
		],
		[
			[
				4
			],
			[
				"liquor"
			]
		]
	]
],
[
	"Plastics Facility",
	[
		"space",
		"plastics_facility.png",
		[
			[
				2,
				2,
				2,
				3,
				3
			],
			[
				"food",
				"energy",
				"water",
				"nebula gas",
				"chemical supplies"
			]
		],
		[
			[
				6
			],
			[
				"heavy plastics"
			]
		]
	]
],
[
	"Smelting Facility",
	[
		"space",
		"smelting_facility.png",
		[
			[
				2,
				2,
				2,
				4
			],
			[
				"food",
				"energy",
				"water",
				"ore"
			]
		],
		[
			[
				6
			],
			[
				"metal"
			]
		]
	]
],
[
	"Optics Research Center",
	[
		"space",
		"optics_research_center.png",
		[
			[
				1,
				3,
				1,
				2
			],
			[
				"food",
				"energy",
				"water",
				"gem stones",
			]
		],
		[
			[
				10
			],
			[
				"optical components"
			]
		]
	]
],
[
	"Slave Camp",
	[
		"energy",
		"slave_camp.png",
		[
			[
				3,
				1,
				3,
				2,
				2
			],
			[
				"food",
				"energy",
				"water",
				"medicines",
				"liquor"
			]
		],
		[
			[
				3
			],
			[
				"slaves"
			]
		]
	]
],
[
	"Electronics Facility",
	[
		"space",
		"electronics_facility.png",
		[
			[
				1,
				4,
				1,
				2,
				3
			],
			[
				"food",
				"energy",
				"water",
				"heavy plastics",
				"metal"
			]
		],
		[
			[
				6
			],
			[
				"electronics"
			]
		]
	]
],
[
	"Recyclotron",
	[
		"space",
		"recyclotron.png",
		[
			[
				5,
				3,
				1
			],
			[
				"bio waste",
				"energy",
				"chemical supplies"
			]
		],
		[
			[
				7,
				5
			],
			[
				"food",
				"water"
			]
		]
	]
],
[
	"Clod Generator",
	[
		"space",
		"clod_generator.png",
		[
			[
				18,
				4,
				4
			],
			[
				"bio waste",
				"energy",
				"chemical supplies"
			]
		],
		[
			[
				5
			],
			[
				"nutrient clods"
			]
		]
	]
],
[
	"Nebula Plant",
	[
		"nebula",
		"nebula_plant.png",
		[
			[
				2,
				2,
				3
			],
			[
				"food",
				"water",
				"exotic matter"
			]
		],
		[
			[
				35,
				4
			],
			[
				"energy",
				"nebula gas"
			]
		]
	]
],
[
	"Drug Station",
	[
		"energy",
		"drug_station.png",
		[
			[
				3,
				1,
				3,
				3,
				4
			],
			[
				"food",
				"energy",
				"water",
				"exotic matter",
				"slaves"
			]
		],
		[
			[
				1
			],
			[
				"drugs"
			]
		]
	]
],
[
	"Dark Dome",
	[
		"energy",
		"dark_dome.png",
		[
			[
				1,
				3
			],
			[
				"energy",
				"slaves"
			]
		],
		[
			[
				12,
				4
			],
			[
				"bodyparts",
				"bio waste"
			]
		]
	]
],
[
	"Handweapons Factory",
	[
		"space",
		"handweapons_factory.png",
		[
			[
				1,
				2,
				1,
				3,
				3,
				3
			],
			[
				"food",
				"energy",
				"water",
				"heavy plastics",
				"optical components",
				"electronics"
			]
		],
		[
			[
				2
			],
			[
				"hand weapons"
			]
		]
	]
],
[
	"Battleweapons Factory",
	[
		"space",
		"battleweapons_factory.png",
		[
			[
				1,
				2,
				1,
				3,
				4,
				3
			],
			[
				"food",
				"energy",
				"water",
				"metal",
				"optical components",
				"electronics"
			]
		],
		[
			[
				2
			],
			[
				"battleweapon parts"
			]
		]
	]
],
[
	"Robot Factory",
	[
		"space",
		"robot_factory.png",
		[
			[
				2,
				2,
				2,
				1,
				2,
				4
			],
			[
				"food",
				"energy",
				"water",
				"metal",
				"optical components",
				"electronics"
			]
		],
		[
			[
				3
			],
			[
				"robots"
			]
		]
	]
],
[
	"Droid Assembly Complex",
	[
		"space",
		"droid_assembly_complex.png",
		[
			[
				1,
				3,
				1,
				3,
				2
			],
			[
				"food",
				"energy",
				"water",
				"radioactive cells",
				"robots"
			]
		],
		[
			[
				1
			],
			[
				"droid modules"
			]
		]
	]
],
[
	"Leech Nursery",
	[
		"space",
		"leech_nursery.png",
		[
			[
				2,
				6,
				10,
				6,
				40
			],
			[
				"food",
				"energy",
				"water",
				"radioactive cells",
				"nutrient clods"
			]
		],
		[
			[
				1,
				3
			],
			[
				"leech baby",
				"bio waste"
			]
		]
	]
],
[
	"Military Outpost",
	[
		"space,nebula,asteriods,energy",
		"military_outpost.png",
		[
			[
				5,
				5
			],
			[
				"hydrogen fuel",
				"energy"
			]
		],
		[
			[
			],
			[
			]
		]
	]
],
[
	"Trade Outpost",
	[
		"space,nebula,energy",
		"trade_outpost.png",
		[
			[
			],
			[
			]
		],
		[
			[
			],
			[
			]
		]
	]
],
[
	"Alliance Command Station",
	[
		"space,nebula,energy",
		"alliance_command_station.png",
		[
			[
				6,
				2
			],
			[
				"energy",
				"radioactive cells",
			]
		],
		[
			[
			],
			[
			]
		]
	]
],
[
	"Player Starbase (on Space)",
	[
		"space",
		"starbase_p0_s4.png",
		[
			[
				3,
				2
			],
			[
				"food",
				"water"
			]
		],
		[
			[
				4,
				1,
				1.25
			],
			[
				"energy",
				"animal embryos",
				"hydrogen fuel"
			]
		]
	]
],
[
	"Player Starbase (on Nebula)",
	[
		"nebula",
		"starbase_p0_s4.png",
		[
			[
				3,
				2
			],
			[
				"food",
				"water"
			]
		],
		[
			[
				4,
				1,
				1.25
			],
			[
				"energy",
				"animal embryos",
				"nebula gas"
			]
		]
	]
],
[
	"Player Starbase (on Energy)",
	[
		"energy",
		"starbase_p0_s4.png",
		[
			[
				3,
				2
			],
			[
				"food",
				"water"
			]
		],
		[
			[
				5.25,
				1
			],
			[
				"energy",
				"animal embryos"
			]
		]
	]
],
[
	"NPC Starbase (on Space)",
	[
		"space",
		"starbase_f0_s4.png",
		[
			[
				2.5,
				1.75
			],
			[
				"food",
				"water"
			]
		],
		[
			[
				2.75,
				1.25,
				1
			],
			[
				"energy",
				"animal embryos",
				"hydrogen fuel"
			]
		]
	]
],
[
	"NPC Starbase (on Nebula)",
	[
		"nebula",
		"starbase_f0_s4.png",
		[
			[
				2.5,
				1.75
			],
			[
				"food",
				"water"
			]
		],
		[
			[
				2.75,
				1.25,
				1
			],
			[
				"energy",
				"animal embryos",
				"nebula gas"
			]
		]
	]
],
[
	"NPC Starbase (on Energy)",
	[
		"energy",
		"starbase_f0_s4.png",
		[
			[
				2.5,
				1.75
			],
			[
				"food",
				"water"
			]
		],
		[
			[
				3.75,
				1.25
			],
			[
				"energy",
				"animal embryos"
			]
		]
	]
],
[
	"Class A Planet",
	[
		"space",
		"planet_a.png",
		[
			[
				12.5
			],
			[
				"energy"
			]
		],
		[
			[
				10,
				10
			],
			[
				"food",
				"water"
			]
		]
	]
],
[
	"Class D Planet",
	[
		"space",
		"planet_d.png",
		[
			[
				2.5,
				0.5
			],
			[
				"water",
				"gem stones"
			]
		],
		[
			[
				0.15
			],
			[
				"slaves"
			]
		]
	]
],
[

	"Class G Planet",
	[
		"space",
		"planet_g.png",
		[
			[
				1.5,
				2.5
			],
			[
				"food",
				"energy"
			]
		],
		[
			[
				0.75,
				5,
				0.5
			],
			[
				"animal embryos",
				"nebula gas",
				"chemical supplies"
			]
		]
	]
],
[
	"Class A Planet",
	[
		"space",
		"planet_a.png",
		[
			[
				12.5
			],
			[
				"energy"
			]
		],
		[
			[
				10,
				10
			],
			[
				"food",
				"water"
			]
		]
	]
],
[
	"Class I Planet",
	[
		"space",
		"planet_i.png",
		[
			[
				7.5
			],
			[
				"energy"
			]
		],
		[
			[
				8,
				0.1
			],
			[
				"water",
				"animal embryos"
			]
		]
	]
],
[
	"Class M Planet",
	[
		"space",
		"planet_m.png",
		[
			[
				7.5
			],
			[
				"energy"
			]
		],
		[
			[
				3.5,
				4
			],
			[
				"food",
				"water"
			]
		]
	]
],
[
	"Drug Station (TSS)",
	[
		"energy",
		"drug_station.png",
		[
			[
				3,
				1,
				3,
				3,
				3
			],
			[
				"food",
				"energy",
				"water",
				"exotic matter",
				"slaves"
			]
		],
		[
			[
				1
			],
			[
				"drugs"
			]
		]
	]
],
[
	"Dark Dome (TSS)",
	[
		"energy",
		"dark_dome.png",
		[
			[
				1,
				2
			],
			[
				"energy",
				"slaves"
			]
		],
		[
			[
				12,
				4
			],
			[
				"bodyparts",
				"bio waste"
			]
		]
	]
]
];













var cnum = new Array();
cnum["food"] = 0;
cnum["energy"] = 1;
cnum["water"] = 2;
cnum["animal embryos"] = 3;
cnum["ore"] = 4;
cnum["metal"] = 5;
cnum["electronics"] = 6;
cnum["robots"] = 7;
cnum["heavy plastics"] = 8;
cnum["hand weapons"] = 9;
cnum["medicines"] = 10;
cnum["nebula gas"] = 11;
cnum["chemical supplies"] = 12;
cnum["gem stones"] = 13;
cnum["liquor"] = 14;
cnum["hydrogen fuel"] = 15;
cnum["exotic matter"] = 16;
cnum["optical components"] = 17;
cnum["radioactive cells"] = 18;
cnum["droid modules"] = 19;
cnum["bio waste"] = 20;
cnum["nutrient clods"] = 21;
cnum["battleweapon parts"] = 22;
cnum["slaves"] = 23;
cnum["drugs"] = 24;
cnum["leech baby"] = 25;
cnum["bodyparts"] = 26;

const cname =
[
"food",
"energy",
"water",
"animal embryos",
"ore",
"metal",
"electronics",
"robots",
"heavy plastics",
"hand weapons",
"medicines",
"nebula gas",
"chemical supplies",
"gem stones",
"liquor",
"hydrogen fuel",
"exotic matter",
"optical components",
"radioactive cells",
"droid modules",
"bio waste",
"nutrient clods",
"battleweapon parts",
"slaves",
"drugs",
"leech baby",
"bodyparts"
]